class MyCalendar {

    List<int[]> booked;

    public MyCalendar() {
        booked = new ArrayList<>();
    }
    
    public boolean book(int start, int end) {
        for(int[] arr : booked) {
            int left = arr[0];
            int rigth = arr[1];
            if(end > left && start < rigth) {
                return false;
            }
        }
        booked.add(new int[]{start,end});
        return true;
    }
}

/**
 * Your MyCalendar object will be instantiated and called as such:
 * MyCalendar obj = new MyCalendar();
 * boolean param_1 = obj.book(start,end);
 */